package cn.jsj.node;

import java.util.List;

import javax.servlet.http.HttpSession;

/**
 * 树形节点生成器类
 * @author LI
 *
 */
public class TreeNodeFactory {

	/**
	 *
	 * @param role：用户权限分：律师，主任，行政人员
	 * @param fatherid：树形节点的ID。如
	 *            root1，root2，root11，root21等
	 * @return 一次节点为父节点的子节点的链表
	 */
	public List getTreeNodesByFatherId(String fatherid,String name) {
		String role="";
		try{
			HttpSession session = cn.jsj.utils.GetWebSession.getSession();
		    role = (Integer) session.getAttribute("popedomLevel")+"";
		    //调试信息
		    cn.jsj.utils.SysLogger.PrintInfo(role);
		}catch (Exception e) {
           cn.jsj.utils.SysLogger.PrintExceptionr(e.fillInStackTrace());
		}

		 //获得用户的权限级别
		role = role.trim();
		java.util.List TreeNodeList = null;
		ParseXML px = null;
		try {
			px = ParseXML.getInstance(role.trim());
			TreeNodeList = px.productTreeNodesByFatherId(fatherid);
		} catch (Exception e) {
			cn.jsj.utils.SysLogger.PrintExceptionr(e.getMessage());
		}
		cn.jsj.utils.SysLogger.PrintInfo(TreeNodeList);
		return TreeNodeList;
	}
}